const express = require("express")
const router = express.Router()
const articleHandle = require("../router_handler/article")
const expressJoi = require("@escook/express-joi")
const {add_article_schema} = require("../schema/article")
// 导入 multer 和 path
const multer = require("multer")
const path = require("path")
const uploads = multer({dest:path.join(__dirname,"../uploads")})


router.post("/add",uploads.single("cover_img"),expressJoi(add_article_schema),articleHandle.addArticle)

module.exports = router